<?php
/**
 * Created by PhpStorm.
 * User: Edik
 * Date: 2016/3/2
 * Time: 15:10
 */

namespace Home\Controller;


use Admin\Model\NewsModel;

class NewsController extends BaseController
{
    function index(){
        $model = new NewsModel();
        $id = I('get.id',1);

        $this->assign('new',$model->where('article_type = '.$id.' and article_class = 2')->select());

        $this->assign("menu", "news");
        $this->assign("id", $id);
        $this->display();
    }

    function xq(){
        $model = new NewsModel();
        $id = I('get.id',1);
        $aid = I('get.aid',1);

        $this->assign('new',$model->where('id = '.$aid)->find());

        $this->assign("menu", "news");
        $this->assign("id", $id);
        $this->display();
    }

}